package phoenix.web.locators.base;

import org.openqa.selenium.By;

import phoenix.core.data_models.TestUserDataModel;

/**
 * Class provides base locators on Search page
 */
public abstract class SearchPageLocatorsBase
{
	public By blockUserList = By.id("user-list");
	public By imgSiteLogo = By.xpath("//img[@alt='site logo']");

	// User menu
	public By blockUserMenu = By.xpath("//*[@class='b-user-nav']");
	public By blockUserMenuPhoto;
	public By linkSettings = By.xpath("//div[@id='userNav']//a[@href='/#account']");
	public By linkProfile = By.xpath("//div[@id='userNav']//a[@href='/#profile']");
	public By linkContactUs = By.xpath("//div[@id='userNav']//a[@href='/#site/contactUs']");
	public By linkLogout = By.xpath("//div[@id='userNav']//a[@href='/site/logout']");
	public By linkBlocked = By.xpath("//div[@id='userNav']//a[@href='/#blocked']");

	// Search menu
	public By blockSearchMenu = By.xpath("//*[@id='dataSearchMenu']//*[@class='button']");
	public By linkSearchNear = By.xpath("//*[@id='dataSearchMenu']//li[@data-type='near_you']");
	public By linkSearchOnline = By.xpath("//*[@id='dataSearchMenu']//li[@data-type='online']");
	public By linkSearchRecently = By.xpath("//*[@id='dataSearchMenu']//li[@data-type='new_members']");
	public By linkSMSChat = By.xpath("//*[@id='dataSearchMenu']//li[@data-type='new_members']");
	public By blockCoregPopup = By.id("coreg-popup-item");
	public By blockSearchMenuCurrent = By.xpath("//*[@id='dataSearchMenu']//a");

	// Activity menu
	public By linkActivityMenu = By.xpath("//div[@id='dataSearchMenu']/a");
	public By linkActivityMyFriends = By.xpath("//ul[@class='search-category-list']//li[@data-type='favourite']/a");
	public By linkActivityBrowsedMe = By.xpath("//ul[@class='search-category-list']//li[@data-type='view']/a");
	public By linkActivityMessagedMe = By.xpath("//ul[@class='search-category-list']//li[@data-type='mail']/a");
	public By linkActivityWinkedMe = By.xpath("//ul[@class='search-category-list']//li[@data-type='wink']/a");
	public By linkActivityFeed = By.xpath("//ul[@class='search-category-list']//li[@data-type='newsFeed']/a");
	public By linkActivitySMSChat = By.xpath("(//*[contains(@href,'#smsChatFeed')])[2]");

	// Top menu
	public By linkTopMyFriends = By.xpath("//div[@id='site-nav']//a[contains(@class,'site-nav-favorites')]");
	public By linkTopBrowsedMe = By.xpath("//div[@id='site-nav']//a[contains(@class,'site-nav-views')]");
	public By linkTopMessagedMe = By.xpath("//div[@id='site-nav']//a[contains(@class,'site-nav-messenger')]");
	public By linkTopWinkedMe = By.xpath("//div[@id='site-nav']//a[contains(@class,'site-nav-winks')]");
	public By linkTopFeed = By.xpath("//div[@id='site-nav']//a[contains(@class,'site-nav-newsfeed')]");
	public By linkTopChatRoom = By.xpath("//div[@id='site-nav']//a[contains(@class,'rooms')]");

	public By linkTopSearch;
	public By linkTopActivity;
	public By btnClosePopup = By.id("popupClose");
	public By btnCloseCoregPopup = By.id("popup-close");
	public By blockSMSChatHistory;
	public By blockPopUpAlert = By.xpath("//div[@id='activityNotification']");
	public By linkViewMoreActivitySMSChat;

	public By popupSMSChat = By.cssSelector(".b-popup.b-sms-chat");

	// DropMenu Locators
	public By blockDropMenu = By.id("activity-tooltip");
	public By btnClosePopupAlert = By.xpath("//a[@class='b-close']");

	public By txtScreenName(String p_name)
	{
		return By.xpath("//span[contains(.,'" + p_name + "')]");
	}

	public By userById(String Id)
	{
		return By.xpath("//a[@href='/#user/view/id/" + Id + "']");
	}

	// wildbuddies
	public By btnNavigationList;
	public By linkTopInbox;

	// Search results
	public By blockPageLoad = By.xpath("//*[@class='l-frame loading']");
	public By blockUserListItem = By.cssSelector("div.b-user");
	public By blockRelatedResults = By.cssSelector("div.b-completion-divider");
	public By blockUsersListActivity = By.xpath(".//*[@id='user-list']//li");
	public By blockUsersListActivityFriendsBtn = By.xpath(".//*[@id='user-list']//li//a[@class='btn-activity btn-favorite activated']");
	public By blockUsersListAll = By.xpath("//li/*[contains(@class, 'b-user')]");
	public By blockUsersListCurrent = By.xpath("//li/*[contains(@class, 'b-user')]//*[@class='btn-more labels-custom']");
	public By linkAddToFriend = By.xpath("//li/*[contains(@class, 'b-user')]//a[contains(@class,'btn-activity btn-favorite')]");
	public By linkScreenname = By.xpath("//li/*[contains(@class, 'b-user')]//h2[@class='b-screenname']/a");

	// Names of the action menu buttons
	public By nameOfFavorits = By.linkText("My Friends");
	public By nameOfBrowse = By.linkText("Browsed Me");
	public By nameOfMessage = By.linkText("Messaged Me");
	public By nameOfWink = By.linkText("Winked at Me");
	public By nameOfFeed = By.linkText("Activity Feed");

	public By btnLogo = By.cssSelector("img[alt=\"site logo\"]");
	public By txtTitle = By.xpath("//*[@id='frm-content']/div/div/h1");
	public By txtAboutMe = By.xpath("//*[@class='b-row-wrap']/div[@class='title']");
	public By txtLogin = By.id("LoginForm_email");

	public By blockMessenger = By.cssSelector("div.c-talks");
	public By linkCloseMessenger = By.cssSelector("a.b-close");

	/**
	 * Text elements
	 */
	public By txtUserSreenname = By.className("b-screenname");
	public By txtUserListAge = By.cssSelector("div.b-user-info > div.b-age");
	public By txtUserListDistanse = By.cssSelector("div.from-you");
	public By txtUserCounty = By.className("country");

	// Images
	public By imgProfile = By.cssSelector("img.photo.labels-custom");

	// Options in menu
	public By optionRadius = By.xpath("//a[@class='active']");
	public By optionRadius50 = By.xpath("//*[@id='search-form-distance-list']//a[@data-list-item='50']");

	// Buttons
	public By btnSearch = By.id("btn-search");
	public By blockBannerUpgrade = By.xpath("//*[@id='user-list']//*[@class='b-upgrade-banner']");
	public By btnBanner = By.xpath("//*[@class='b-btn']//a[contains(@href,'/pay/membership')]");
	public By btnUserMessenger; // Button at user profile in search

	// Links
	public By linkPromoComm = By.cssSelector("a.b-free-communicate");
	public By linkPromoSearch = By.xpath("//a[@class='b-vip']");

	// Page favorites users
	public By blockPhotoPaidFeatures = By.xpath(".//*[@class='b-features']");
	public By linkFreeCommunicate = By.xpath(".//*[@class='b-free-communicate']");
	public By linkInvisibleMode = By.xpath(".//*[@class='b-invisible']");
	public By linkVipInSearch = By.xpath(".//*[@class='b-vip']");
	public By linkHotUser = By.xpath(".//*[@class='b-hot']");

	//
	public By blockUploadedUsers = By.xpath("(//*[@class='b-grid-item'])[last()]");
	public By blockSearchResults = By.xpath("//*[@id='user-list']");
	public By blockUserPhoto = By.xpath(".//*[@class='b-photo'])[1]");

	// Selects
	public By selectGender = By.xpath("//span[@class='gender value']");
	public By selectGenderM = By.xpath("//ul/li[@data-select-list-item='1']");
	public By selectGenderF = By.xpath("//ul/li[@data-select-list-item='2']");
	public By selectAgeFrom = By.id("search-form-age-from");
	public By selectAgeTo = By.id("search-form-age-to");
	public By selectLocation = By.id("search-form-location");
	public By selectLocationValue = By.id("search-form-location-value");
	public By blockLocation = By.cssSelector("div.b-location"); // Used by NF

	public By btnRadius = By.xpath("//a[@class='active']");

	public By blockPromoComm = By.cssSelector("a.b-free-communicate");
	public By blockPromoSearch = By.xpath("//a[@class='b-vip']");

	// Search block at Toolbar
	public By btnEditSearch = By.id("searchFormToggle");
	public By btnBannerUpgrade = By.cssSelector("a.btn.btn-update");
	public By blockAdvancedSearch = By.id("searchForm");

	// Counters
	public By blockMessagedMeCounter;
	public By blockBrowsedMeCounter;
	public By blockWinkedMeCounter;
	public By blockFavoritsCounter;
	public By blockNewsFeedsCounter;

	// Pop-up alerts
	public By blockMessageAlert = By.xpath("//div[@class='b-menu-notification mail active']");
	public By blockWinkAlert = By.xpath("//div[@class='b-menu-notification wink active']");
	public By blockBrowseAlert = By.xpath("//div[@class='b-menu-notification view active']");

	public By blockResultsMessage = By.cssSelector(".b-results-message");
	public By btnContinuePopup = By.xpath("//*[@class='b-popup-content b-successfully']//*[@value='Continue']");
	public By btnSMSPopupClose = By.id("popupClose");

	public By optionRadius20;
	public By optionRadius100;
	public By linkUserPage;
	public By linkMenuInboxWinks;
	public By linkMenuInboxMessages;
	public By linkMenuInboxLetters;
	public By linkMenuInboxChats;
	public By linkMenuInboxAllComminucations;
	public By blockUserLastVisible;

	// CNF specified locator
	public By btnMessengerOpen(TestUserDataModel p_user)
	{
		return By.xpath("//button[@onclick=\"Backbone.trigger('Talks.Start', '" + p_user.getId() + "');\"]");
	}

	// wildbuddies specified locator
	public By btnUserMessengerOpen(Integer p_id)
	{
		return By.xpath("(//a[contains(text(),'Message')])[" + p_id + "]");
	}

	// wildbuddies and benaughty specified locator
	public By btnByPostcode(String p_id)
	{
		return By.xpath("//div[@data-city='" + p_id + "']");
	}

	// benaughty Messenger open from search
	public By btnByUserMessenger(TestUserDataModel p_user)
	{
		return By.xpath("//a[@onclick=\"Backbone.trigger('Talks.Start', '" + p_user.getId() + "')\"]");
	}

	public By linkCountryListSuggest;

	// foreigngirlfriend locators
	public By btnTopMenuGetCredits;
	public By btnBannerGetCredits;
	public By blockMember;
	public By btnOpenChat;
	public By btnSendLetter;

	/**
	 *@ MD related
	 */
	public By setLocatorByValue(String p_value, By p_baseLocator)
	{
		return null;
	}

}